/ Assembly List / LJCDBDataAccess / DbDataAccess / Delete

Namespace - LJCDBDataAccess


Returns

The result XML message.

Syntax

C#
private DbResult Delete()

Deletes a record. (E)

Remarks

This method is called from the Execute() method if the DbRequest.QueryType is "Delete".

Example

C#
// Deletes a record.
private static void Delete(DbDataAccess dbDataAccess
  , DbColumns dataDefinition)
{
  // Create Key Columns.
  var keyColumns = new DbColumns()
  {
    { "Name", (object)"TestNameUpdated" }
  };
  dataDefinition.LJCSetExcludeKeyValue("PrincipleFlag");

  var queryKeyColumns = DbCommon.QueryKeys(keyColumns, dataDefinition);
  DbRequest dbRequest = new DbRequest()
  {
    KeyColumns = queryKeyColumns
    QueryType = QueryType.Delete.ToString(),
    TableName = "PersonTest",
  };
  DbResult dbResult = dbDataAccess.Execute(dbRequest);

  if (dbResult != null)
  {
    string sqlStatement = dbResult.ExecutedSql;
  }
}